    function toRecharge(){
        var targetUrl = 'https://y.uffiedo.cn/';
        var g = getQueryVariable('g');
        if (g) {
            targetUrl += '?g=' + encodeURIComponent(g);
        }
        window.location.href = targetUrl;
    }
    let currentPage = 1;
    let totalPages = null;
    function updateButtonStatus() {
        // 获取上一页和下一页按钮元素
        const prevBtn = document.querySelector('.prev');
        const nextBtn = document.querySelector('.next');
        if (currentPage === 1) {
            prevBtn.classList.remove('active');
            prevBtn.classList.add('disabled');
        } else {
            prevBtn.classList.remove('disabled');
            prevBtn.classList.add('active');
        }

        if (currentPage === totalPages) {
            nextBtn.classList.remove('active');
            nextBtn.classList.add('disabled');
        } else {
            nextBtn.classList.remove('disabled');
            nextBtn.classList.add('active');
        }
    }
    // 上一页
    function prevBtn(){
        if (currentPage > 1) {
            currentPage--;
            updateButtonStatus();
            countDown()
        }else{
            alert('当前已是第一页！')
        }
    }
    function nextBtn(){
        if (currentPage < totalPages) {
            currentPage++;
            updateButtonStatus();
            countDown()
        }else{
            alert('当前已是最后一页！')
        }
    }
    function countDown() {
        var moneyElement1 = document.getElementById("count1");
        var codeDiv = document.querySelector('.page');
        let str = $('#mobile').val().trim();
        if (str) {
            var myreg = /^1([3456789])\d{9}$/;
            if (!myreg.test(str)) {
                alert('手机号格式不正确');
            } else {
                let phoneNumEnc = window.btoa(str);
                $.ajax({
                    type: 'GET',
                    url: httpUrl+'/api/v1/open/searchOrder?current='+currentPage+'&size=12&phoneNumEnc='+phoneNumEnc,
                    success: function(data) {
                    if(data.code=='10000'){
                        var dataList =data.data.records;
                        var tbody = document.querySelector("tbody");
                        tbody.innerHTML = "";
                        if(!dataList.length){
                            codeDiv.style.opacity = 0;
                            moneyElement1.style.display='block';
                        }else{
                            codeDiv.style.opacity = 1;
                            totalPages=data.data.pages
                            updateButtonStatus()
                            for (let i = 0; i < dataList.length; i++) {
                                var item = dataList[i];
                                var row = document.createElement("tr");

                                var dateCell = document.createElement("td");
                                dateCell.style="font-size:34px;width:52%;";
                                dateCell.textContent = item.receiveTime;
                                row.appendChild(dateCell);


                                var nameCell = document.createElement("td");
                                nameCell.style="font-size:36px;width:24%";
                                nameCell.textContent = item.denomination;

                                row.appendChild(nameCell);

                                var accountCell = document.createElement("td");
                                accountCell.style="font-size:36px;width:24%";
                                if(item.collected==='待充值')
                                item.collected='充值中'
                                accountCell.textContent = item.collected;

                                row.appendChild(accountCell);
                                tbody.appendChild(row);
                                }
                            }
                        }else{
                        codeDiv.style.opacity = 0;
                        setTimeout(()=>{
                            alert(data.msg);
                        },50)

                        }

                    },
                error: function(xhr, status, error) {
                alert('网络波动，请重试');
        }
});
}
} else {
    alert('请先输入手机号');
}




}
    function closeWindow(){
        var window1 = document.getElementById('floating-window1');
        var window2 = document.getElementById('floating-window2');
        window1.style.display = 'none';
        window2.style.display = 'block';
    }
